<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ShopHomeUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        //创建前台用户表
        Schema::create('shop_home_users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 50);
            $table->string('passname', 100);
            $table->unsignedTinyInteger('sex')->comment('0:女;1:男');
            $table->string('pic', 255);
            $table->string('email', 50);
            $table->string('phone', 14);
            $table->unsignedTinyInteger('user_status')->default(1)->comment('1:允许登录;2:禁止登录');
            $table->unsignedTinyInteger('member')->default(1)->comment('1:普通会员;2:黄金会员;3:钻石会员');
            $table->timestamps();

            $table->unique('email');
            $table->unique('phone');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('shop_home_users');
    }
}
